#ifndef _PROTOCOL_HPP_
#define	_PROTOCOL_HPP_
/*******************************************************************************
 ** Name: protocol.hpp                                                        **
 ** Description:                                                              **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 **  Copyright (c) 2009-2010 Barry "Gian" James  <bjames@munixos.net>         **
 **  All rights reserved.                                                     **
 **                                                                           **
 **  Redistribution and use in source and binary forms, with or without       **
 **  modification, are permitted provided that the following conditions are   **
 **  met:                                                                     **
 **                                                                           **
 **  * Redistributions of source code must retain the above copyright notice, **
 **    this list of conditions and the following disclaimer.                  **
 **  * Redistributions in binary form must reproduce the above copyright      **
 **    notice, this list of conditions and the following disclaimer in the    **
 **    documentation and/or other materials provided with the distribution.   **
 **                                                                           **
 **  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      **
 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED **
 ** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A           **
 ** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT        **
 ** HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,    **
 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED  **
 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR    **
 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    **
 ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING      **
 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS        **
 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.              **
 **                                                                           **
 ******************************************************************************/
// Created on April 4, 2010, 4:09 AM
// Modified $Date: 2011-09-18 21:48:59 +0000 (Sun, 18 Sep 2011) $ by $Author: gian.james $
#define protocol_hpp_ID   "$Id: protocol.hpp 145 2011-09-18 21:48:59Z gian.james $"

#include <string>

// The client simply takes what's typed in and sends it out its socket
// or maybe it massages the data into a package to take the load off the
// server?
//--> @Deprecated
// From client to server format:
// :cmd | <args>
// From client to server nlp format:
// take pistol from desk

/*
 * |-------------|-----------------------------------------------------|
 *    8-bit cmd               1-254 byte data
 */

#define DEFAULT_MAX_ARGC	8

enum class ProtocolCmd : uint8_t {
	NULL_CMD,
	CmdAck,			// Ok
	CmdError,		// Error - see below for more detailed error responses
	Login,
	NewCharacter,
		NCName,
		NCAttrUpdate,	// sends attr:points|attr:points|etc for new attributes
		NCProfession,
		NCBackground,
		NCOccupation,
		NCSkills,
		NCStats,	// age,gender,height,weight,eyes,hair,skin
	DelCharacter,

	// Game play functions
	Predicate,	// a game command (ie say, tell, take, look)

	// Game Control functions
	CreateObject,
	DestroyObject,
	EditObject,
	ChownObject,
	CloneObject,
	ExamineObject,
	DisconnectClient,
	ExamineClient,
	GetClientPassword,
	SetClientPassword,	// control command
	ChangePassword,		// user command
	GiveItem,
	CreateNPC,
	DeleteNPC,
	KillNPC,
	Shutdown,
	Reboot,
	CreateChannel,
	DestroyChannel,
	EditChannel,
	ChannelList,
	OpenChannel,	// open created channel for comms
	CloseChannel,	// close a channel (doesn't destroy)
	CheckMail,
	SendMail,
	DeleteMail,
	WhoIsOnline,
	WhoIs,
	SetDoing,		// sets "doing" string in "WhoIs"
	DumpDatabase,
	Entrances,		// lists entrances and exit links in current location
	Quit,
	History,		// command history
	Last,			// last/recent login information
	Inventory,		// print what's in the inventory
	Character,		// show character sheet
	Dossier,	// character,agency,service record book, etc
	Profession,	// list known professions
	Background,
	Occupation,
	Trait,
	Feat,			// list top-level feats
	Help,
	ListTableNames,	// list internal table names
	ListQueueContents,
	ListMessages,	// list IM messages
	DeleteMessage,
	SendMessage,
	ReadMessage,
	SetMOTD,
	Wallop,		// send message to all ops
	Wall,		// send message to all
	Stats,		// display object breakdown
	Teleport,	// move to a far away location
	Version,	// list software version information
	Log,		// write message to log

	// World Commands
	LinkEntrance,
	UnlinkEntrance,	// unlink an exit/entrance to location
	LoadScript,		// load a script
	CreateArea,
	DestroyArea,
	EditArea,
	ExamineArea,

	// Response error codes
	ErrorOutofBounds,
	ErrorUnknown,
	ErrorArgCount,

	ProtocolCmds
};

class PktProtocol
{
public:
    explicit PktProtocol(const char *);

//    operator const wchar_t * () { return cmdString.data(); }
    int     Count() const { return argc; }
    char **	Vector() { return argv; }
    
private:
//    std::wstring cmdString;

    char **      argv;
    int             argc;
};






#endif	/* _PROTOCOL_HPP_ */

